﻿<Window x:Class="Nox.Amuse.View.SimpleNewWorldDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        mc:Ignorable="d"
        Height="280"
        Width="400"
        Title="Add New World"
        ShowInTaskbar="False"
        ResizeMode="NoResize"
        Icon="/Amuse;component/Amuse.ico"
        WindowStartupLocation="CenterOwner"
        FocusManager.FocusedElement="{Binding ElementName=textBoxName}">
    <Grid Margin="11">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Border Grid.ColumnSpan="4"
                Margin="-11,-11,-11,0">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1"
                                     StartPoint="0.5,0"
                                     Opacity="0.5">
                    <GradientStop Offset="0"
                                  Color="{StaticResource AmuseBlue}" />
                    <GradientStop Color="White"
                                  Offset="0.4" />
                </LinearGradientBrush>
            </Border.Background>
        </Border>
        <TextBlock Grid.ColumnSpan="2"
                   HorizontalAlignment="Left"
                   Text="Enter world details"
                   VerticalAlignment="Center"
                   Foreground="DodgerBlue"
                   FontSize="18"
                   Margin="0,0,0,11" />
        <Label Grid.Row="1"
               Content="_Name:"
               HorizontalAlignment="Right"
               Target="{Binding ElementName=textBoxName}"
               Margin="0,0,5,7" />
        <TextBox Grid.Row="1"
                 Grid.Column="1"
                 x:Name="textBoxName"
                 Text="{Binding DisplayName, UpdateSourceTrigger=PropertyChanged}"
                 HorizontalAlignment="Left"
                 Width="200"
                 Margin="0,0,5,7" />
        <Label Grid.Row="2"
               Content="_Address:"
               HorizontalAlignment="Right"
               Target="{Binding ElementName=textBoxAddress}"
               Margin="0,0,5,7" />
        <TextBox Grid.Row="2"
                 Grid.Column="1"
                 x:Name="textBoxAddress"
                 Text="{Binding Address, UpdateSourceTrigger=PropertyChanged}"
                 HorizontalAlignment="Left"
                 Width="200"
                 Margin="0,0,5,7" />
        <Label Grid.Row="3"
               Content="_Port:"
               HorizontalAlignment="Right"
               Target="{Binding ElementName=textBoxPort}"
               Margin="0,0,5,7" />
        <TextBox Grid.Row="3"
                 Grid.Column="1"
                 x:Name="textBoxPort"
                 Text="{Binding Port, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                 HorizontalAlignment="Left"
                 Width="75"
                 Margin="0,0,5,7" />
        <ContentPresenter Grid.Column="1"
                          Grid.Row="4"
                          Content="{Binding ElementName=textBoxPort, Path=(Validation.Errors).CurrentItem}">
            <ContentPresenter.ContentTemplate>
                <DataTemplate>
                    <TextBlock Foreground="DarkRed"
                               FontStyle="Italic"
                               TextWrapping="Wrap"
                               Text="{Binding Path=ErrorContent}" />
                </DataTemplate>
            </ContentPresenter.ContentTemplate>
        </ContentPresenter>
        <Border Grid.Row="5"
                Grid.ColumnSpan="2"
                Margin="-11,0,-11,-11">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1"
                                     StartPoint="0.5,0"
                                     Opacity="0.5">
                    <GradientStop Color="White"
                                  Offset="0.2" />
                    <GradientStop Color="{StaticResource {x:Static SystemColors.ControlDarkColorKey}}"
                                  Offset="1" />
                </LinearGradientBrush>
            </Border.Background>
        </Border>
        <StackPanel Orientation="Horizontal"
                    Grid.Column="1"
                    Grid.Row="5"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Bottom">
            <Button Content="_Save"
                    Margin="7,0"
                    IsDefault="True"
                    Command="{Binding SaveCommand}" />
            <Button Content="_Cancel"
                    IsCancel="True" />
        </StackPanel>
    </Grid>
</Window>
